Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
illuna-minetest
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Illuna-Minetest
illuna-minetest
Commits
c1e0d3e0
Commit
c1e0d3e0
authored
14 years ago
by
Perttu Ahola
Browse files
Options
Downloads
Patches
Plain Diff
some tinkering around
parent
a5c62045
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Makefile
+1
-1
1 addition, 1 deletion
Makefile
src/main.cpp
+37
-4
37 additions, 4 deletions
src/main.cpp
src/server.cpp
+6
-8
6 additions, 8 deletions
src/server.cpp
with
44 additions
and
13 deletions
Makefile
+
1
−
1
View file @
c1e0d3e0
# Makefile for Irrlicht Examples
# It's usually sufficient to change just the target name and source file list
# and be sure that CXX is set to a valid compiler
SOURCE_FILES
=
materials.cpp guiTextInputMenu.cpp guiInventoryMenu.cpp irrlichtwrapper.cpp guiPauseMenu.cpp defaultsettings.cpp mapnode.cpp tile.cpp voxel.cpp mapblockobject.cpp inventory.cpp debug.cpp serialization.cpp light.cpp filesys.cpp connection.cpp environment.cpp client.cpp server.cpp socket.cpp mapblock.cpp mapsector.cpp heightmap.cpp map.cpp player.cpp utility.cpp main.cpp test.cpp
SOURCE_FILES
=
guiMessageMenu.cpp
materials.cpp guiTextInputMenu.cpp guiInventoryMenu.cpp irrlichtwrapper.cpp guiPauseMenu.cpp defaultsettings.cpp mapnode.cpp tile.cpp voxel.cpp mapblockobject.cpp inventory.cpp debug.cpp serialization.cpp light.cpp filesys.cpp connection.cpp environment.cpp client.cpp server.cpp socket.cpp mapblock.cpp mapsector.cpp heightmap.cpp map.cpp player.cpp utility.cpp main.cpp test.cpp
DEBUG_TARGET
=
debugtest
DEBUG_SOURCES
=
$(
addprefix src/,
$(
SOURCE_FILES
))
...
...
This diff is collapsed.
Click to expand it.
src/main.cpp
+
37
−
4
View file @
c1e0d3e0
...
...
@@ -245,6 +245,7 @@ TODO: Transferring of the table from server to client
#include
"guiInventoryMenu.h"
#include
"guiTextInputMenu.h"
#include
"materials.h"
//#include "guiMessageMenu.h"
IrrlichtWrapper
*
g_irrlicht
;
...
...
@@ -1537,10 +1538,15 @@ int main(int argc, char *argv[])
// Test the text input system
/*(new GUITextInputMenu(guienv, guiroot, -1, &g_active_menu_count,
NULL))->drop();*/
/*GUIMessageMenu *menu =
new GUIMessageMenu(guienv, guiroot, -1,
&g_active_menu_count,
L"Asd");
menu->drop();*/
// Launch pause menu
(
new
GUIPauseMenu
(
guienv
,
guiroot
,
-
1
,
g_device
,
&
g_active_menu_count
))
->
drop
();
/*
(new GUIPauseMenu(guienv, guiroot, -1, g_device,
&g_active_menu_count))->drop();
*/
// First line of debug text
gui
::
IGUIStaticText
*
guitext
=
guienv
->
addStaticText
(
...
...
@@ -1565,6 +1571,7 @@ int main(int argc, char *argv[])
L"Chat here
\n
Other line
\n
Other line
\n
Other line
\n
Other line"
,
core
::
rect
<
s32
>
(
70
,
60
,
795
,
150
),
false
,
true
);
chat_guitext
->
setBackgroundColor
(
video
::
SColor
(
96
,
0
,
0
,
0
));
core
::
list
<
ChatLine
>
chat_lines
;
/*
...
...
@@ -1574,6 +1581,9 @@ int main(int argc, char *argv[])
u32
beginscenetime
=
0
;
u32
scenetime
=
0
;
u32
endscenetime
=
0
;
// A test
//throw con::PeerNotFoundException("lol");
/*
Main loop
...
...
@@ -2353,7 +2363,7 @@ int main(int argc, char *argv[])
i
!=
chat_lines
.
end
();
i
++
)
{
(
*
i
).
age
+=
dtime
;
if
((
*
i
).
age
>
6
0.0
)
if
((
*
i
).
age
>
30
0.0
)
{
to_be_removed_count
++
;
continue
;
...
...
@@ -2530,6 +2540,29 @@ int main(int argc, char *argv[])
catch
(
con
::
PeerNotFoundException
&
e
)
{
dstream
<<
DTIME
<<
"Connection timed out."
<<
std
::
endl
;
/*if(g_device)
{
GUIMessageMenu *menu =
new GUIMessageMenu(guienv, guiroot, -1,
&g_active_menu_count,
L"Connection timed out");
video::IVideoDriver* driver = g_device->getVideoDriver();
dstream<<"Created menu"<<std::endl;
while(g_device->run() && menu->getStatus() == false)
{
driver->beginScene(true, true, video::SColor(255,0,0,0));
guienv->drawAll();
driver->endScene();
}
dstream<<"Dropping menu"<<std::endl;
menu->drop();
}*/
}
#if CATCH_UNHANDLED_EXCEPTIONS
/*
...
...
This diff is collapsed.
Click to expand it.
src/server.cpp
+
6
−
8
View file @
c1e0d3e0
...
...
@@ -2313,6 +2313,11 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
dstream
<<
"CHAT: "
<<
wide_to_narrow
(
message
)
<<
std
::
endl
;
// Get player name of this client
std
::
wstring
name
=
narrow_to_wide
(
player
->
getName
());
std
::
wstring
line
=
std
::
wstring
(
L"<"
)
+
name
+
L"> "
+
message
;
/*
Send the message to all other clients
*/
...
...
@@ -2330,14 +2335,7 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
if
(
peer_id
==
client
->
peer_id
)
continue
;
// Get player name of this client
std
::
wstring
name
=
L"unknown"
;
Player
*
player
=
m_env
.
getPlayer
(
client
->
peer_id
);
if
(
player
!=
NULL
)
name
=
narrow_to_wide
(
player
->
getName
());
SendChatMessage
(
client
->
peer_id
,
std
::
wstring
(
L"<"
)
+
name
+
L"> "
+
message
);
SendChatMessage
(
client
->
peer_id
,
line
);
}
}
else
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment