Commit 29c01a63 authored by Linda Sekawati's avatar Linda Sekawati
Browse files

Random Map

parent b08281b8
......@@ -4,6 +4,7 @@ import hashlib
import pymongo
import threading
from pymongo import MongoClient
from random import randint
# informasi port dan socket
hostTracker = "167.205.32.46"
......@@ -400,7 +401,9 @@ def playserver(portLaptop):
else:
response = "{'status' : 'fail', 'description' : 'offer is not available'}"
elif (method == 'map'):
response = '{"status" : "ok", "name" : "Bandar Behari", "width" : 10, "height" : 10}'
width = randint(5,15)
height = width
response = '{"status" : "ok", "name" : "Bandar Behari", "width" : ' + str(width) + ', "height" : ' + str(height) + '}'
elif (method == 'move'):
response = '{"status" : "ok", "time" : 123456}'
elif (method == 'field'):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment