"""This file contains the required functions for the editing features""" import base from hypershade.cubescript import playerCS, CSCommand from hyperserv.servercommands import ServerError editentnumber=base.packettypenumber("EDITENT") editentlength=base.packettypes[editentnumber][1] i=0 imax=5000 istart=5000 @CSCommand("ent","trusted") def entcommand(caller, *args): ent(args) def ent(args): if len(args)==editentlength: j=args[0] args=args[1:] elif len(args)==editentlength-1: global i i+=1 i%=imax j=i else: raise ServerError("EDITENT must have 9(if id is unspecified) or 10 arguments.") base.packetSendingQueue.put((editentnumber,j+istart)+args)
"""This file contains the required functions for the editing features""" import base from hypershade.cubescript import playerCS, CSCommand from hyperserv.servercommands import ServerError editfnumber = base.packettypenumber("EDITF") editflength = base.packettypes[editfnumber][1] @CSCommand("editf", "trusted") def editfcommand(caller, *args): editf(*map(int, args)) def editf(*args): if len(args) != editflength: raise ServerError("EDITF must have %s arguments." % editflength) base.packetSendingQueue.put((editfnumber,) + args) @CSCommand("makecube", "trusted") def makecube(caller, x, y, z, s=16): s = int(s) x = int(x) * s y = int(y) * s z = int(z) * s editf(x + s, y, z, 1, 1, 1, s, 0, 0, 2, 0, 2, 1, -1, 1) @CSCommand("makecolumn", "trusted")