public void FillTableList() { conn.CreateConnection(ConnectionHandler.Server, ConnectionHandler.Database, ConnectionHandler.Username, ConnectionHandler.Password); lstTables.Items.Clear(); lstTables.Items.AddRange(conn.GetListOfTables().ToArray()); logg1.Log("Koblet til database " + ConnectionHandler.Database + ". Lister ut tabeller." + Environment.NewLine, Logg.LogType.Info); }
void Host_MigrateRequest(object sender, MigrateRequestEventArgs e) { DestinationClient = new Client(e.Adress, e.Port, Logg); DestinationClient.DataReceived += DestinationClient_DataReceived; Logg.Log(string.Format("Migration réussit avec succes, server de jeux : {0}: {1} .", e.Adress, e.Port), LogLevelEnum.Succes); Host.Bot.BotState = BotStatsEnum.INACTIF; }
void DestinationClient_DataReceived(object sender, Client.DataReceivedEventArgs e) { NetworkMessage message = ProtocolManager.GetPacket(e.Data.Data, (uint)e.Data.MessageId); Host.Dispatcher.DispatchMessage(message, Host); Logg.Log("From server :" + message.MessageId.ToString()); }
void Host_PreMigrateRequest(object sender, EventArgs e) { IsMigrating = true; Host.Bot.BotState = BotStatsEnum.MIGRATING; SourceClient.Stop(); DestinationClient.Stop(); Logg.Log("Préparation de la migration ..."); }
public override void SendMessage(NetworkMessage message, DestinationEnum destination) { CustomDataWriter writer = new CustomDataWriter(); message.Pack(writer); DestinationClient.Send(writer.Data); Logg.Log("Sent to server :" + message.MessageId.ToString()); }