Пример #1
0
 public static void sendSpectateFail(ClientHandler h)
 {
     try
     {
         if (h != null && h.Bw != null)
         {
             h.Bw.Write((short)SendHeaders.SPECTATE_FAIL);
         }
         else
         {
             h.abort();
         }
     }
     catch (Exception e)
     {
         h.abort(e);
     }
 }
Пример #2
0
 public static void endSpectateRecord(ClientHandler h)
 {
     try
     {
         if (h != null & h.Bw != null)
         {
             h.Bw.Write((short)SendHeaders.SPECTATE_END);
         }
         else
         {
             h.abort();
         }
     }
     catch (Exception e)
     {
         h.abort(e);
     }
 }
Пример #3
0
 public static void sendSpectateFinish(ClientHandler h, int score, int combo, int per, int gr, int ok, int miss, int flags, double acc)
 {
     try
     {
         if (h != null && h.Bw != null)
         {
             h.Bw.Write((short)SendHeaders.SPECTATE_FINISH);
             h.Bw.Write(score);
             h.Bw.Write(combo);
             h.Bw.Write(per);
             h.Bw.Write(gr);
             h.Bw.Write(ok);
             h.Bw.Write(miss);
             h.Bw.Write(flags);
             h.Bw.Write(acc);
         }
         else
         {
             h.abort();
         }
     }
     catch (Exception e)
     {
         h.abort(e);
     }
 }
Пример #4
0
 public static void sendUserInfo(ClientHandler ch, User u, string usr)
 {
     try
     {
         BinaryWriter Bw = ch.Bw;
         if (ch != null && Bw != null)
         {
             Bw.Write((short)SendHeaders.USER_REQUEST_INFO);
             //Console.WriteLine(u.Name);
             //online bool, name,realname,,avatar,playcount,totalscore,mode,currentsong,currentchart, accuracy, level
             if (u == null)
             {
                 Bw.Write(false);
                 Bw.Write(usr);
             }
             else
             {
                 Bw.Write(true);
                 Bw.Write(u.Name);
                 Bw.Write(u.RealName);
                 Bw.Write(u.Avatar);
                 Bw.Write(u.Playcount);
                 Bw.Write(u.TotalScore);
                 Bw.Write((int)u.Mode);
                 Bw.Write(u.CurrentSong);
                 Bw.Write(u.CurrentChart);
                 Bw.Write(u.Accuracy);
                 Bw.Write(u.Level);
             }
         }
         else
         {
             ch.abort();
         }
     }
     catch (Exception e)
     {
         ch.abort(e);
     }
 }
Пример #5
0
 public static void sendSpectateUsersMe(ClientHandler h, string list)
 {
     try
     {
         if (h != null && h.Bw != null)
         {
             h.Bw.Write((short)SendHeaders.SPECTATE_USERS_ME);
             h.Bw.Write(list);
         }
         else
         {
             h.abort();
         }
     }
     catch (Exception e)
     {
         h.abort(e);
     }
 }
Пример #6
0
 public static void sendSpectateStart(ClientHandler h, string user, string md5, int mods, double scroll)
 {
     try
     {
         if (h != null && h.Bw != null)
         {
             h.Bw.Write((short)SendHeaders.SPECTATE_START);
             h.Bw.Write(user);
             h.Bw.Write(md5);
             h.Bw.Write(mods);
             h.Bw.Write(scroll);
         }
         else
         {
             h.abort();
         }
     }
     catch (Exception e)
     {
         h.abort(e);
     }
 }
Пример #7
0
 public static void sendSpectateRelease(ClientHandler h, int off, int lane)
 {
     try
     {
         if (h != null && h.Bw != null)
         {
             h.Bw.Write((short)SendHeaders.SPECTATE_RELEASE);
             h.Bw.Write(off);
             h.Bw.Write(lane);
         }
         else
         {
             h.abort();
         }
     }
     catch (Exception e)
     {
         h.abort(e);
     }
 }
Пример #8
0
 public static void sendSpectateHit(ClientHandler h, int off, int diff, int lane, int type)
 {
     try
     {
         if (h != null && h.Bw != null)
         {
             h.Bw.Write((short)SendHeaders.SPECTATE_HIT);
             h.Bw.Write(off);
             h.Bw.Write(diff);
             h.Bw.Write(lane);
             h.Bw.Write(type);
         }
         else
         {
             h.abort();
         }
     }
     catch (Exception e)
     {
         h.abort(e);
     }
 }
Пример #9
0
 public static void sendSpectateHeartbeat(ClientHandler h, int off, int score, int combo, int hp, double acc)
 {
     try
     {
         if (h != null && h.Bw != null)
         {
             h.Bw.Write((short)SendHeaders.SPECTATE_HEARTBEAT);
             h.Bw.Write(off);
             h.Bw.Write(score);
             h.Bw.Write(combo);
             h.Bw.Write(hp);
             h.Bw.Write(acc);
         }
         else
         {
             h.abort();
         }
     }
     catch (Exception e)
     {
         h.abort(e);
     }
 }