mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 18:52:22 +00:00
World <-> Login connection reworked
This commit is contained in:
+7
-15
@@ -34,7 +34,6 @@
|
||||
#include <signal.h>
|
||||
|
||||
#include "../common/net/tcp_server.h"
|
||||
#include "../common/net/servertalk_server.h"
|
||||
#include "../common/net/servertalk_client_connection.h"
|
||||
|
||||
ChatChannelList *ChannelList;
|
||||
@@ -146,21 +145,14 @@ int main() {
|
||||
|
||||
worldserver->Connect();
|
||||
|
||||
EQ::Net::ServertalkServer server;
|
||||
EQ::Net::ServertalkServerOptions opts;
|
||||
opts.port = 5999;
|
||||
opts.credentials = "User:Root;Password:1234567890";
|
||||
server.Listen(opts);
|
||||
|
||||
server.OnConnectionIdentified("QueryServ", [](std::shared_ptr<EQ::Net::ServertalkServerConnection> conn) {
|
||||
Log.Out(Logs::General, Logs::Debug, "New QueryServ Connection....");
|
||||
});
|
||||
|
||||
server.OnConnectionRemoved("QueryServ", [](std::shared_ptr<EQ::Net::ServertalkServerConnection> conn) {
|
||||
Log.Out(Logs::General, Logs::Debug, "Lost QueryServ connection.");
|
||||
});
|
||||
|
||||
EQ::Net::ServertalkClient client("127.0.0.1", 5999, false, "QueryServ", "User:Root;Password:1234567890");
|
||||
client.OnMessage(1, [&](uint16_t opcode, EQ::Net::Packet &p) {
|
||||
Log.OutF(Logs::General, Logs::Debug, "Client got message of type {0}\n{1}", opcode, p.ToString());
|
||||
|
||||
EQ::Net::WritablePacket out;
|
||||
out.PutCString(0, "Why Hello");
|
||||
client.Send(2, out);
|
||||
});
|
||||
|
||||
while(RunLoops) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user