Advertisement
Guest User

Untitled

a guest
Jul 8th, 2014
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.40 KB | None | 0 0
  1. List rooms
  2. int userId = readint
  3. string userName = readstring
  4. int roomsNumber = readint
  5.  
  6.  
  7. rooms = new list(roomsNumber)
  8.  
  9.  
  10. int roomsCounter =0;
  11. while(roomsCounter < roomsNumber)
  12. {
  13. //Chat Record Data
  14. //Notice that each ChatRecordData has it's own context and chatlog
  15. //For every room that the user has been you will have a ChatRecordData
  16. //Appending a post from a group forum is a possibility (they have website forums)
  17.  
  18. new hashtable context // must be hashtable;
  19. new List<Chatlogs> chatlogs
  20.  
  21. byte chatDataType = readbyte //0-4
  22. // type 0 = nothing
  23. // type 1 = roomChatlog
  24. // type 2 = IM Session : Internal mods chat ?
  25. // type 3 = Forum Thread
  26. // type 4 = Forum Message : Website forum or group forum ?
  27. // Notice that both in-game chat messages and forum messages will look the same client-side speaking
  28. // There is a in-game tool in which the mod can delete a forum post or thread
  29. // A mod cannot delete a room chatlog in oposite to forum messages
  30.  
  31. short contextNumber = readshort
  32. short contextCounter = 0;
  33.  
  34. while(contextCounter < contextNumber)
  35. {
  36. string contextKey = readstring
  37. // keys: {roomName,groupId,threadId,messageId,roomId}
  38. int contextDataType = (int)readbyte
  39. switch(contextDataType)
  40. {
  41. case 0:
  42. context[contextKey] = readbool
  43. break
  44. case 1:
  45. context[contextKey] = readint
  46. break
  47. case 2:
  48. context[contextKey] = readstring
  49. break
  50. deafult:
  51. Unknown data type
  52. }
  53. k++;
  54. }
  55.  
  56. //finally, you append the chatlog list
  57. //Each context data is associed to only one chatlog list
  58.  
  59. int chatlogsNumber = (int)readshort // 0-65535
  60. int chatlogsCounter = 0;
  61. while(chatlogsCounter < chatlogsNumber)
  62. {
  63. //notice that you are appending the chat for everyone in the room/thread
  64. //if the userId is the same as the reported user that you are browing, the chat color should change
  65. int timestamp = readint
  66. int userId = readint //0 if 'bot/pet'
  67. string userName = readstring
  68. string message = readstring
  69. bool colorBool = readbool //defines a color for something. Must test
  70.  
  71. k++
  72. }
  73. roomsCounter++
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement