World <-> Login connection reworked

This commit is contained in:
KimLS
2016-10-28 19:02:03 -07:00
parent fab8765c2f
commit 0b8b41d91f
32 changed files with 729 additions and 701 deletions
+7 -15
View File
@@ -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) {