Guest User

Untitled

a guest
Jan 24th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.36 KB | None | 0 0
  1. websocket connetion to `ws:/ws`
  2. everything is sent as serialized json objects
  3.  
  4. # from server to client
  5.  
  6. ## initial dump of all the users' details
  7.  
  8. {"t":"Au":"users":{$all_users_serialized},"groups":{$all_groups_serialized}}
  9.  
  10. this should be the first thing that's received upon connecting
  11.  
  12. ## message
  13.  
  14. {"t":"m","i":$message_id_number,"ts":"2006-01-02T15:04:05.999Z07:00","uid":$author_id_number,"c":"$message_contents"}
  15.  
  16. ## error
  17.  
  18. {"t":"error","m":"$error_message"}
  19.  
  20. ## info
  21.  
  22. {"t":"info","m":"$info_message"}
  23.  
  24. ## user connecting
  25.  
  26. {"t":"u+","u":{$all_user_fields_serialized}}
  27.  
  28. a user has connected
  29.  
  30. ## user connection changing
  31.  
  32. {"t":"u*","u":{$all_user_fields_serialized}}
  33.  
  34. user has been modified in some way and should be updated (sends everything, not just the change)
  35.  
  36. ## user connection ended
  37.  
  38. {"t":"u-","uid":$user_id_number}
  39.  
  40. user has went away and has no messages in history, all related information can be released
  41.  
  42. ## current connection's user has changed
  43.  
  44. {"t":"su","id":$user_id_number}
  45.  
  46. connection is from now on using the specified user
  47.  
  48. # from client to server
  49.  
  50. ## message
  51.  
  52. {"t":"m","c":"$message_text"}
  53.  
  54. posts a message, if current user can and post rate is not exceeded. might queue `"t":"m"` on success
  55.  
  56. ## sign in
  57.  
  58. {"t":"sign in","name":"$user_name","pass":"$user_password"}
  59.  
  60. changes current user. might queue `"t":"su"` on succcess or `"t":"error"` on failure
  61.  
  62. ## sign up
  63.  
  64. {"t":"sign up","name":"$user_name","pass0":"$user_password","pass1":"$user_password"}
  65.  
  66. creates new user *only*. might queue `"t":"info"` on success or `"t":"error"` on failure
  67.  
  68. ## password change
  69.  
  70. {"t":"chpass","c-pass":"$user_password","pass0":"$new_user_password","pass1":"$new_user_password"}
  71.  
  72. changes current user password, if it's possible. might queue `"t":"info"` on success or `"t":"error"` on failure
  73.  
  74.  
  75. ## style change
  76.  
  77. {"t":"style", }
  78.  
  79. modifies current user's styles that are specified. migth queue `"t":"user style change"` on if stars align or `"t":"error"` on failure
  80.  
  81. ## moving users between groups
  82.  
  83. {"t":"move","group":"$group_name","u":$user_id_number}
  84.  
  85. if current user has the power, moves the specified user to another group. might queue `"t":"error"` on failure or `"t":"u*"` on success (probably, can't make it out just from hub.go)
  86.  
  87. ## deleting posts
  88.  
  89. {"t":"del","msg-id":$post_id_number}
  90.  
  91. removes a post. might queue `"t":"del"` on success
Add Comment
Please, Sign In to add comment