Tasharen Entertainment Forum
Support => TNet 3 Support => Topic started by: Tauti on June 15, 2015, 09:57:01 PM
Title:
Server AI
Post by:
Tauti
on
June 15, 2015, 09:57:01 PM
Hi all, how to organize the logic of AI on the server. For example, every 10 minutes the server sends a message to all "Hello world."
Title:
Re: Server AI
Post by:
devomage
on
June 15, 2015, 11:00:20 PM
look at this code within ServerMain.cs:
add a custom packet and send desired data to a channel.
// Save periodically
mSaveThread
=
new
Thread
(
delegate
(
object
obj
)
{
for
(
;
;
)
{
Thread
.
Sleep
(
120000
)
;
if
(
mGameServer
!=
null
)
mGameServer
.
SaveTo
(
mFilename
)
;
}
}
)
;
mSaveThread
.
Start
(
)
;