X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;f=server%2Futils.py;h=c8f1c380bafba5cab203895d81d6a189c1dae34c;hb=HEAD;hp=22acb0dec6564eda7729be8b918e2e85ee9232a6;hpb=f8865085362ad23898ac4b6a00db3b915226d9d3;p=plomrogue diff --git a/server/utils.py b/server/utils.py index 22acb0d..c8f1c38 100644 --- a/server/utils.py +++ b/server/utils.py @@ -84,8 +84,14 @@ def prep_library(): def c_pointer_to_bytearray(ba): """Return C char * pointer to ba.""" - type = ctypes.c_char * len(ba) - return type.from_buffer(ba) + ty = ctypes.c_char * len(ba) + return ty.from_buffer(ba) + + +def c_pointer_to_string(string): + """Return C char * pointer to string.""" + p = ctypes.c_char_p(string.encode("ascii")) + return p def parse_command_line_arguments(): @@ -96,7 +102,8 @@ def parse_command_line_arguments(): action='store') parser.add_argument('-l', nargs="?", const="save", dest='savefile', action="store") - parser.add_argument('-w', type=str, default="confserver/world", + parser.add_argument('-w', type=str, + default="confserver/PleaseTheIslandGod", dest='worldconf', action='store') parser.add_argument('-v', dest='verbose', action='store_true') opts, unknown = parser.parse_known_args()