Beispiel #1
0
 internal void LoadArena(SnowStorm War)
 {
     ServerMessage StageStarting = new ServerMessage(Outgoing.Game2StageStartingMessageEvent);
     StageStarting.AppendInt32(0);
     StageStarting.AppendString("snowwar_arena_0");
     StageStarting.AppendInt32(5);
     this.CheckArenaStatic(StageStarting, War);
     int xyz = 0;
     foreach (Habbo habbo in War.WarUsers)
     {
         //habbo.SnowUserId = xyz;
         StageStarting.AppendInt32(5);
         //StageStarting.AppendInt32(0);
         StageStarting.AppendInt32(habbo.SnowUserId);
         StageStarting.AppendInt32(habbo.SnowX);
         StageStarting.AppendInt32(habbo.SnowY);
         StageStarting.AppendInt32((int)(habbo.SnowX / 0xc80));
         StageStarting.AppendInt32((int)(habbo.SnowY / 0xc80));
         StageStarting.AppendInt32(habbo.SnowRot);
         StageStarting.AppendInt32(5);
         StageStarting.AppendInt32(5);
         StageStarting.AppendInt32(0);
         StageStarting.AppendInt32(0);
         StageStarting.AppendInt32(0);
         StageStarting.AppendInt32((int)(habbo.SnowX / 0xc80));
         StageStarting.AppendInt32((int)(habbo.SnowY / 0xc80));
         StageStarting.AppendInt32(habbo.SnowX);
         StageStarting.AppendInt32(habbo.SnowY);
         StageStarting.AppendInt32(0);
         //StageStarting.AppendInt32(0);
         StageStarting.AppendInt32(habbo.SnowTeam);
         StageStarting.AppendInt32(habbo.Id);
         StageStarting.AppendString(habbo.Username);
         StageStarting.AppendString(habbo.Motto);
         StageStarting.AppendString(habbo.Figure);
         StageStarting.AppendString(habbo.Gender.ToLower());
         xyz++;
     }
     War.SendToStorm(StageStarting, false, 0);
     Thread.Sleep(5000);
     foreach (Habbo habbo in War.WarUsers)
     {
         ServerMessage PlayerExited = new ServerMessage(Outgoing.Game2PlayerExitedGameArenaMessageEvent);
         PlayerExited.AppendInt32(habbo.Id);
         PlayerExited.AppendInt32(20);
         habbo.GetClient().SendMessage(PlayerExited);
     }
     Thread thrd = new Thread(delegate()
     {
         int countdown = 120;
         while (countdown != 0)
         {
             ServerMessage StageRunning = new ServerMessage(Outgoing.Game2StageRunningMessageEvent);
             StageRunning.AppendInt32(countdown--);
             War.SendToStorm(StageRunning);
             ServerMessage Message5_0 = new ServerMessage(2352);//Game2FullGameStatusMessageEvent
             Message5_0.AppendInt32(1);
             Message5_0.AppendInt32(1);
             Message5_0.AppendInt32(1);
             Message5_0.AppendInt32(1);
             Message5_0.AppendInt32(1);
             Message5_0.AppendInt32(countdown);
             War.SendToStorm(Message5_0);
             Thread.Sleep(1000);
         }
     });
     thrd.Start();
     War.SnowStormStart();
 }
Beispiel #2
0
 internal void StartGame(SnowStorm War)
 {
     War.AssignTeams();
     War.WarStarted = 1;
     ServerMessage SetStep1 = new ServerMessage(Outgoing.SetStep1);
     SetStep1.AppendInt32(War.WarId);
     SetStep1.AppendString("SnowStorm level " + War.WarLevel);
     SetStep1.AppendInt32(0);
     SetStep1.AppendInt32(War.WarLevel);
     SetStep1.AppendInt32(2);
     SetStep1.AppendInt32(War.MaxUsers);
     SetStep1.AppendString(War.WarOwner.Username);
     SetStep1.AppendInt32(15);
     SetStep1.AppendInt32(War.WarUsers.Count);
     foreach (Habbo habbo in War.WarUsers)
     {
         SetStep1.AppendInt32(habbo.Id);
         SetStep1.AppendString(habbo.Username);
         SetStep1.AppendString(habbo.Figure);
         SetStep1.AppendString((habbo.Gender.ToUpper() == "M") ? "M" : "f");
         SetStep1.AppendInt32(habbo.SnowTeam);
         SetStep1.AppendInt32(habbo.SnowLevel);
         SetStep1.AppendInt32(habbo.SnowPoints);
         SetStep1.AppendInt32(Essential.GetGame().GetStormWars().LevelScore[habbo.SnowLevel]);
     }
     SetStep1.AppendInt32(0);
     SetStep1.AppendInt32(120);
     War.SendToStorm(SetStep1, false, 0);
     ServerMessage EnterArena = new ServerMessage(Outgoing.Game2EnterArenaMessageEvent);
     EnterArena.AppendInt32(0);
     EnterArena.AppendInt32(War.WarLevel);
     EnterArena.AppendInt32(2);
     EnterArena.AppendInt32(War.WarUsers.Count);
     foreach(Habbo habbo in War.WarUsers)
     {
         EnterArena.AppendInt32(habbo.Id);
         EnterArena.AppendString(habbo.Username);
         EnterArena.AppendString(habbo.Figure);
         EnterArena.AppendString(habbo.Gender.ToLower());
         EnterArena.AppendInt32(habbo.SnowTeam);
     }
     EnterArena.AppendInt32(50);
     EnterArena.AppendInt32(50);
     EnterArena.AppendString(War.Model.SerializeHeightMap());
     EnterArena.AppendInt32(War.Model.SnowItems.Count);
     foreach (SnowItems items in War.Model.SnowItems)
     {
         items.SerializeItem(EnterArena);
     }
     War.SendToStorm(EnterArena, false, 0);
     foreach (Habbo habbo in War.WarUsers)
     {
         ServerMessage ArenaEntered = new ServerMessage(Outgoing.Game2ArenaEnteredMessageEvent);
         ArenaEntered.AppendInt32(habbo.Id);
         ArenaEntered.AppendString(habbo.Username);
         ArenaEntered.AppendString(habbo.Figure);
         ArenaEntered.AppendString(habbo.Gender.ToLower());
         ArenaEntered.AppendInt32(habbo.SnowTeam);
         War.SendToStorm(ArenaEntered, false, 0);
     }
     ServerMessage StageLoad = new ServerMessage(Outgoing.Game2StageLoadMessageEvent);
     StageLoad.AppendInt32(0);
     War.SendToStorm(StageLoad, false, 0);
     Action<object> action = delegate(object obj)
     {
         Thread.Sleep(0x1388);
         ServerMessage StageStillLoading = new ServerMessage(Outgoing.Game2StageStillLoadingMessageEvent);
         StageStillLoading.AppendInt32(0);
         StageStillLoading.AppendInt32(0);
         War.SendToStorm(StageStillLoading, false, 0);
         this.LoadArena(War);
     };
     new Task(action, "pingsession").Start();
 }
 internal void LoadArena(SnowStorm War)
 {
     this.GetResponse().Init(Outgoing.Game2StageStartingMessageEvent);
     this.GetResponse().AppendInt32(0);
     this.GetResponse().AppendString("snowwar_arena_0");
     this.GetResponse().AppendInt32(5);
     this.CheckArenaStatic(this.GetResponse(), War);
     foreach (Habbo habbo in War.WarUsers)
     {
         this.GetResponse().AppendInt32(5);
         this.GetResponse().AppendInt32(habbo.SnowUserId);
         this.GetResponse().AppendInt32(habbo.SnowX);
         this.GetResponse().AppendInt32(habbo.SnowY);
         this.GetResponse().AppendInt32((int)(habbo.SnowX / 0xc80));
         this.GetResponse().AppendInt32((int)(habbo.SnowY / 0xc80));
         this.GetResponse().AppendInt32(2);
         this.GetResponse().AppendInt32(5);
         this.GetResponse().AppendInt32(5);
         this.GetResponse().AppendInt32(0);
         this.GetResponse().AppendInt32(0);
         this.GetResponse().AppendInt32(0);
         this.GetResponse().AppendInt32((int)(habbo.SnowX / 0xc80));
         this.GetResponse().AppendInt32((int)(habbo.SnowY / 0xc80));
         this.GetResponse().AppendInt32(habbo.SnowX);
         this.GetResponse().AppendInt32(habbo.SnowY);
         this.GetResponse().AppendInt32(0);
         this.GetResponse().AppendInt32(habbo.SnowTeam);
         this.GetResponse().AppendInt32(habbo.Id);
         this.GetResponse().AppendString(habbo.Username);
         this.GetResponse().AppendString(habbo.Motto);
         this.GetResponse().AppendString(habbo.Figure);
         this.GetResponse().AppendString(habbo.Gender.ToLower());
     }
     War.SendToStorm(this.GetResponse(), false, 0);
     Thread.Sleep(5000);
     foreach (Habbo habbo in War.WarUsers)
     {
         this.GetResponse().Init(Outgoing.Game2PlayerExitedGameArenaMessageEvent);
         this.GetResponse().AppendInt32(habbo.Id);
         this.GetResponse().AppendInt32(20);
         habbo.GetClient().SendMessage(this.GetResponse());
     }
     this.GetResponse().Init(Outgoing.Game2StageRunningMessageEvent);
     this.GetResponse().AppendInt32(120);
     War.SendToStorm(this.GetResponse(), false, 0);
     War.SnowStormStart();
 }