Exemple #1
0
 /// <summary>
 /// Parse an incoming throw from a client
 /// </summary>
 public void Throw(string line)
 {
     if (line.ToLower().StartsWith("throw ") || line.ToLower().StartsWith("t "))
     {
         line = line.Substring(line.IndexOf(" ") + 1);
         if (line.StartsWith("u") || line.StartsWith("up"))
         {
             Server.AddCookie(x, y, directions.up, Server.GetCookieID(), username);
         }
         else if (line.StartsWith("d") || line.StartsWith("down"))
         {
             Server.AddCookie(x, y, directions.down, Server.GetCookieID(), username);
         }
         else if (line.StartsWith("l") || line.StartsWith("left"))
         {
             Server.AddCookie(x, y, directions.left, Server.GetCookieID(), username);
         }
         else if (line.StartsWith("r") || line.StartsWith("right"))
         {
             Server.AddCookie(x, y, directions.right, Server.GetCookieID(), username);
         }
     }
 }