Advertisement
SynMonger

McMyAdmin API Doc

Jun 29th, 2011
417
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.21 KB | None | 0 0
  1. Salvaged from Google Cache. Created by Joshua Vanderburg.
  2.  
  3. Arguments for McMyAdmin
  4.  
  5. To get data from an active McMyAdmin instance, you will send a request to the
  6. following address:
  7.  
  8. http://yoursite.com:8080/data.json
  9.  
  10. It is important to note if you have "domain=+" in your mcmyadmin.conf file, you
  11. can use www.yoursite.com, yoursite.com or the IP address to talk to McMyAdmin.
  12. If you have it set, i.e. domain=yoursite.com, then you can ONLY use
  13. yoursite.com, NOT www.yoursite.com or the IP address.
  14.  
  15. It should be noted that I only know how to manipulate this data in PHP and I
  16. will give examples for doing so. If you are using something else, it's up to
  17. you to find the equivalent.
  18.  
  19. When making a request, it will be sent in the following format:
  20.  
  21. http://yoursite.com:8080/data.json?args
  22.  
  23. where args is the request. As I give exmples, I will only be supplying args,
  24. not the full website string. What is returned when you make a request is a JSON
  25. string. In PHP you can turn this into something useful with the function
  26. json_decode(); This will turn the string into a object. To get it into an array,
  27. you would use the function get_object_vars(); This will create a
  28. multi-dimensional array. It is important to note that only the first index (I
  29. don't know the proper names of these, but I trust you understand) becomes an
  30. array, go a dimension in and it is still an object.
  31.  
  32. ---------------------------
  33. Requesting the status of the server
  34. ---------------------------
  35.  
  36. data.json?req=status
  37.  
  38. This is an example of the object after decoding:
  39.  
  40. stdClass Object
  41. (
  42. [status] => 200
  43. [running] => 1
  44. [ready] => 1
  45. [stopping] =>
  46. [maxram] => 1024
  47. [users] => 1
  48. [maxusers] => 32
  49. [userinfo] => stdClass Object
  50. (
  51. [vanderburg] => stdClass Object
  52. (
  53. [IP] => ***.***.***.***
  54. [ConnectTime] => /Date(1290932397177)/
  55. [LastAskSource] =>
  56. [LastAskType] => 2
  57. [Name] => Vanderburg
  58. )
  59.  
  60. )
  61.  
  62. [ram] => 644
  63. [starttime] => 11/27/2010 8:15:12 PM
  64. [cpuusage] => 3
  65. )
  66.  
  67. It doesn't return an IP address with *, I just did that so you can't get my
  68. private IP. Everything on here is fairly self-explanitory. [stopping] has no
  69. value because in the object it is the boolean "false". The 1s are "true". [ram]
  70. and [maxram] are values in megabytes. [cpuusage] is a percentage of the
  71. processor being used on the McMyAdmin process. [ConnectTime] appears to be
  72. javascript epoch notation (miliseconds since 1970 or whatever) I have not yet
  73. figured out what [LastAskSource] or [LastAskType] are.
  74.  
  75. ----------------------------
  76. sending a message through the console
  77. ----------------------------
  78.  
  79. data.json?req=sendchat&message=SOMEMESSAGE
  80.  
  81. This does not return a string. It will send a message into the game that looks
  82. like "[Server]: SOMEMESSAGE". Fairly straight forward.
  83.  
  84. ----------------------------
  85. Get last console message
  86. ----------------------------
  87.  
  88. data.json?req=getchat&sine=TIMESTAMP
  89.  
  90. After decode:
  91.  
  92. stdClass Object
  93. (
  94. [status] => 200
  95. [chatdata] => Array
  96. (
  97. [0] => stdClass Object
  98. (
  99. [user] => CONSOLE
  100. [message] => Hey, guys.
  101. [timestamp] => Date(1293995277093)
  102. )
  103.  
  104. )
  105.  
  106. )
  107.  
  108. McMyAdmin keeps track of approximately the last 20 messages it has. If you include
  109. the since parameter, it will grab all the messages it has since that time. If you
  110. exlude the since parameter, it will grab all the messages it has in its buffer.
  111.  
  112. [user] is the name of who sent the message, [message] is the string that was sent.
  113. [timestamp] is the javascript epoch notation (miliseconds since 1970)
  114.  
  115. ----------------------------
  116. Getting the McMyAdmin version
  117. ----------------------------
  118.  
  119. data.json?req=versions
  120.  
  121. After decoding:
  122.  
  123. stdClass Object
  124. (
  125. [status] => 200
  126. [backend] => 0.7.6.8
  127. [edition] => Professional
  128. [mc] => 0.2.5_02
  129. [net] => .Net 2.0.50727.4952
  130. )
  131.  
  132. [backend] is the McMyAdmin application. [edition] is your license type. [mc] is
  133. the Minecraft Server vesion. [net] is the version of .NET that McMyAdmin is
  134. running on.
  135.  
  136. ----------------------------
  137. Reset your groups to default
  138. ----------------------------
  139.  
  140. data.json?req=setgroupdefaults
  141.  
  142. Does not return a string. It will clear out all your groups, remove any custom
  143. groups and restore all the default ones.
  144.  
  145. ----------------------------
  146. Gets users in a group
  147. ----------------------------
  148.  
  149. data.json?req=getgroupinfo&grp=GROUPNAME
  150.  
  151. After decoding:
  152.  
  153. stdClass Object
  154. (
  155. [status] => 200
  156. [group] => Administrators
  157. [members] => Array
  158. (
  159. [0] => Sinneslust
  160. [1] => Vanderburg
  161. [2] => PhonicUK
  162. )
  163.  
  164. [commands] => Array
  165. (
  166. [0] => *
  167. [1] => kick
  168. [2] => ban
  169. [3] => ban-ip
  170. [4] => give
  171. [5] => giveme
  172. [6] => giveto
  173. [7] => summon
  174. [8] => lookup
  175. [9] => pardon
  176. [10] => pardon-ip
  177. [11] => save-all
  178. [12] => say
  179. [13] => stats
  180. [14] => tp
  181. [15] => whois
  182. [16] => goto
  183. [17] => lastseen
  184. [18] => ping
  185. )
  186.  
  187. [inherits] =>
  188. [color] => b
  189. [level] => 0
  190. )
  191.  
  192. This will return all the users in a specific group. [group] is the name of the
  193. group you requested. [members] are all your members for that group. This is
  194. already an array, indexed. [commands] are the /commands that that particular
  195. group has access to. This is already an array, indexed. [inherits] is a
  196. true/false boolean in the JSON string; 1 or null in the object. Is states
  197. whether it inherits groups from hMod. [color] is the colors of the text in game
  198. for that group. [level] is an indexed argument of the permissions it has from
  199. hMod.
  200.  
  201. ------------------------------
  202. Get a list of the groups
  203. ------------------------------
  204.  
  205. data.json?req=getgrouplist
  206.  
  207. After decoding:
  208.  
  209. stdClass Object
  210. (
  211. [status] => 200
  212. [groups] => Array
  213. (
  214. [0] => Everyone
  215. [1] => Regulars
  216. [2] => Moderators
  217. [3] => Administrators
  218. [4] => Guests
  219. )
  220.  
  221. )
  222.  
  223. [groups] is an indexed array of each group name.
  224.  
  225. ------------------------------
  226. Add a group item
  227. ------------------------------
  228.  
  229. data.json?req=addgroupvalue&type=TYPE&grp=GROUPVALUE&value=VALUE
  230.  
  231. Does not return a string. If you want to add a user to a group,
  232. TYPE = groupmembers, grp = Everyone, Regulars, Moderators, etc, value = USERNAME.
  233. To add a group to the list, TYPE = groupslist, grp = group, value = GROUPNAME
  234.  
  235. ------------------------------
  236. Delete a group item
  237. ------------------------------
  238.  
  239. data.json?req=removegroupvalue&type=TYPElist&grp=GROUPVALUE&value=VALUE
  240.  
  241. Does not return a string. Values are the same as above.
  242.  
  243. ------------------------------
  244. Retrieve config by key.
  245. ------------------------------
  246.  
  247. ANY ATTEMPT TO REQUEST OR SET A CONFIG KEY NOT LISTED HERE WILL NOT BE HONORED BY
  248. MCMYADMIN (e.g. maxusers, maxram, etc)
  249.  
  250. data.json?req=getconfig&key=KEY
  251.  
  252. Possible Keys:
  253.  
  254. --- whitelist
  255.  
  256. stdClass Object
  257. (
  258. [value] => none
  259. [status] => 200
  260. )
  261.  
  262. [value] is a string declaring the type of whitelist.
  263.  
  264. --- announceplayers
  265.  
  266. stdClass Object
  267. (
  268. [value] => 1
  269. [status] => 200
  270. )
  271.  
  272. [value] is a 1 or 0 (true or false) declaring whether connecting
  273. players are announced in game.
  274.  
  275. --- showpermissionserror
  276.  
  277. stdClass Object
  278. (
  279. [value] => 0
  280. [status] => 200
  281. )
  282.  
  283. [value] is a 1 or 0 (true or false) determining if players are warned with
  284. "Access Denied."
  285.  
  286. --- savewarn
  287.  
  288. stdClass Object
  289. (
  290. [value] => 1
  291. [status] => 200
  292. )
  293.  
  294. [value] is a 1 or 0 (true or false) declaring whether the server will warn
  295. you that it is saving.
  296.  
  297. --- statusimage
  298.  
  299. stdClass Object
  300. (
  301. [value] => 1
  302. [status] => 200
  303. )
  304.  
  305. [value] is a 1 or 0 (true or false) declaring whether the server will
  306. generate an image on the status for your server.
  307.  
  308. --- publiclist
  309.  
  310. stdClass Object
  311. (
  312. [value] => 1
  313. [status] => 200
  314. )
  315.  
  316. [value] is a 1 or 0 (true or false) declaring whether your server is listed
  317. on www.phonicuk.com/serverlist. Setting to true requires telemetry to be enabled.
  318.  
  319. --- allowtelemetry
  320.  
  321. stdClass Object
  322. (
  323. [value] => 1
  324. [status] => 200
  325. )
  326.  
  327. [value] is a 1 or 0 (true or false) declaring whether your server sends back
  328. data on your server. Required to be on if publiclist is to be set to true.
  329.  
  330. --- servername
  331.  
  332. stdClass Object
  333. (
  334. [value] => Frantic Me!
  335. [status] => 200
  336. )
  337.  
  338. [value] is a string of the title of your server.
  339.  
  340. --- motd
  341.  
  342. stdClass Object
  343. (
  344. [value] => Hey there, %p!\nWelcome to %s
  345. [status] => 200
  346. )
  347.  
  348. [value] is a string of the Message of the Day. In the future, I'll include
  349. everything that McMyAdmin will parse.
  350.  
  351. --- spawn-monsters
  352.  
  353. stdClass Object
  354. (
  355. [value] => 1
  356. [status] => 200
  357. )
  358.  
  359. [value] is a 1 or 0 (true or false) declaring whether monsters will spawn
  360. on your server.
  361.  
  362. --- hellworld
  363.  
  364. stdClass Object
  365. (
  366. [value] => 0
  367. [status] => 200
  368. )
  369.  
  370. [value] is a 1 or 0 (true or false) declaring whether your server will
  371. generate hell world style chunks. This will not change existing chunks.
  372.  
  373. --- online-mode
  374.  
  375. stdClass Object
  376. (
  377. [value] => 0
  378. [status] => 200
  379. )
  380.  
  381. [value] is a 1 or 0 (true or false) declaring whether your server checks
  382. with minecraft.net to authenticate users. If turned off, users could pose as
  383. administrators on your server and access their level of commands. Only set to
  384. false if minecraft.net is down.
  385.  
  386. --- hmodcompat
  387.  
  388. stdClass Object
  389. (
  390. [value] => 1
  391. [status] => 200
  392. )
  393.  
  394. [value] is a 1 or 0 (true or false) declaring whether McMyAdmin will overwrite
  395. existing hMod groups and users and replace them with those defined in the Users
  396. and Groups of McMyAdmin.
  397.  
  398. --- spawn-animals
  399.  
  400. stdClass Object
  401. (
  402. [value] => 1
  403. [status] => 200
  404. )
  405.  
  406. [value] is a 1 or 0 (true or false) declaring whether your server will spawn
  407. pigs, cows and chicken/duck hybrids.
  408.  
  409. --- pvp
  410.  
  411. stdClass Object
  412. (
  413. [value] => 1
  414. [status] => 200
  415. )
  416.  
  417. [value] is a 1 or 0 (true or false) declaring whether players can harm each other.
  418.  
  419. -------------------------
  420. Set config by key
  421. -------------------------
  422.  
  423. data.json?req=setconfig&key=KEY
  424.  
  425. Example of table:
  426.  
  427. KEY NAME
  428. POSSIBLE KEY EXPLAINATION
  429. POSSIBLE KEY EXPLAINATION
  430.  
  431. whitelist
  432. none No whitelisting
  433. groups Match any group
  434. history Historical
  435. lockdown Lockdown
  436. both Group Match + Historical
  437.  
  438. announceplayers
  439. 1 True
  440. 0 False
  441.  
  442. showpermissionserror
  443. 1 True
  444. 0 False
  445.  
  446. savewarn
  447. 1 True
  448. 0 False
  449.  
  450. statusimage
  451. 1 True
  452. 0 False
  453.  
  454. publiclist
  455. 1 True
  456. 0 False
  457.  
  458. allowtelemetry
  459. 1 True
  460. 0 False
  461.  
  462. servername
  463. string This can be anything
  464.  
  465. motd
  466. string This can be anything
  467.  
  468. spawn-monsters
  469. 1 True
  470. 0 False
  471.  
  472. hellworld
  473. 1 True
  474. 0 False
  475.  
  476. online-mode
  477. 1 True
  478. 0 False
  479.  
  480. hmodcompat
  481. 1 True
  482. 0 False
  483.  
  484. spawn-animals
  485. 1 True
  486. 0 False
  487.  
  488. pvp
  489. 1 True
  490. 0 False
  491.  
  492. -------------------------
  493. Get McMyAdmin Schedule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement