message 2
message 2
gamedown = false
handlers.fuckingbanme = function(args)
{
Banned
}
handlers.dobanprocess3 = function(args)
{
if (hostids.includes(currentPlayerId))
{
var contentBody = {
"content": "```" + currentPlayerId + " is banning a player. User banning is in
ModeratorIds list.```"
};
var url = "https://discord.com/api/webhooks/1195183585301377104/M6uWS--ECWxoP2i-
9P43tknO4muqtx2q5otGAzO3cWokk0mHISPFUISgjCsLALx0qBox";
var method = "post";
var contentType = "application/json";
var headers = {};
var responseString =
http.request(url,method,JSON.stringify(contentBody),contentType,headers);
handlers.docurrencyselfprocess3 = function(args)
{
if (hostids.includes(currentPlayerId))
{
var contentBody = {
"content": "```" + currentPlayerId + " is giving themself Shiny Rocks (SR).
User is in ModeratorIds list.```"
};
var url = "https://discord.com/api/webhooks/1195183585301377104/M6uWS--ECWxoP2i-
9P43tknO4muqtx2q5otGAzO3cWokk0mHISPFUISgjCsLALx0qBox";
var method = "post";
var contentType = "application/json";
var headers = {};
var responseString =
http.request(url,method,JSON.stringify(contentBody),contentType,headers);
if (hostids.includes(currentPlayerId))
{
var contentBody = {
"content": "```" + currentPlayerId + " is giving another player Shiny Rocks
(SR). User giving is in ModeratorIds list.```"
};
var url = "https://discord.com/api/webhooks/1195183585301377104/M6uWS--ECWxoP2i-
9P43tknO4muqtx2q5otGAzO3cWokk0mHISPFUISgjCsLALx0qBox";
var method = "post";
var contentType = "application/json";
var headers = {};
var responseString =
http.request(url,method,JSON.stringify(contentBody),contentType,headers);
}
}
// You can use the "log" object to write out debugging statements. It has
// three functions corresponding to logging level: debug, info, and error.
These functions
// take a message string and an optional object.
log.info(message);
var inputValue = null;
if (args && args.inputValue)
inputValue = args.inputValue;
log.debug("helloWorld:", { input: args.inputValue });
// The value you return from a Cloud Script function is passed back
// to the game client in the ExecuteCloudScript API response, along with any
log statements
// and additional diagnostic information, such as any errors returned by API
calls or external HTTP
// requests. They are also included in the optional player_executed_cloudscript
PlayStream event
// generated by the function execution.
// (https://api.playfab.com/playstream/docs/PlayStreamEventModels/player/
player_executed_cloudscript)
return { messageValue: message };
};
message = "tet"
};
handlers.Report = function(args) {
var reason = args.reason;
var target = args.target;
var playerdoing = args.playerdoing;
var todo = args.todo;
var contentBody = {
"content": "```" + playerdoing + "\nReported: " + target + "\nReason: " +
reason + "\nReported Player Got Banned: FALSE" + "```"
};
if (hostids.includes(currentPlayerId))
var contentBody = {
"content": "```" + playerdoing + "\nReported: " + target + "\nReason: " +
reason + "\nReported Player Got Banned: TRUE" + "```"
};
if (hostids.includes(currentPlayerId))
{
server.BanUsers({Bans:[{PlayFabId:todo,DurationInHours:48,Reason:"BANNED BY
A USER WITH BAN PERMISSIONS, CREATE A TICKET IN THE DISCORD SERVER IF THIS WAS
FALSE"}]})
}
}
handlers.ThroughMessage = function(args)
{
var msg = args.msg;
var rsn = args.rsn;
var pli = args.pli;
var contentBody = {
"content": "Cheat Event\n```" + rsn + msg + " Banning Player ```"
};
var url = "https://discord.com/api/webhooks/1195183585301377104/M6uWS--ECWxoP2i-
9P43tknO4muqtx2q5otGAzO3cWokk0mHISPFUISgjCsLALx0qBox";
var method = "post";
var contentType = "application/json";
var headers = {};
var responseString =
http.request(url,method,JSON.stringify(contentBody),contentType,headers);
server.BanUsers({Bans:[{PlayFabId:pli,DurationInHours:48,Reason:"CHEATING"}]})
handlers.IsOnline = function(args) {
var whatever = args.whatever;
var contentBody = {
"content": whatever
};
var url = "https://discord.com/api/webhooks/1195183585301377104/M6uWS--ECWxoP2i-
9P43tknO4muqtx2q5otGAzO3cWokk0mHISPFUISgjCsLALx0qBox";
var method = "post";
var contentType = "application/json";
var headers = {};
var responseString =
http.request(url,method,JSON.stringify(contentBody),contentType,headers);
}
handlers.playerBanned = function(args) {
var contentBody = {
"content": "```A Player Was Banned" + "\nUserId: " + currentPlayerId + "```"
};
var url = "https://discord.com/api/webhooks/1195183585301377104/M6uWS--ECWxoP2i-
9P43tknO4muqtx2q5otGAzO3cWokk0mHISPFUISgjCsLALx0qBox";
var method = "post";
var contentType = "application/json";
var headers = {};
var responseString =
http.request(url,method,JSON.stringify(contentBody),contentType,headers);
}
handlers.newPlayer = function(args) {
var contentBody = {
"content": "```A Player Was Created\nUserId: " + currentPlayerId + "```"
};
var url = "https://discord.com/api/webhooks/1195183585301377104/M6uWS--ECWxoP2i-
9P43tknO4muqtx2q5otGAzO3cWokk0mHISPFUISgjCsLALx0qBox";
var method = "post";
var contentType = "application/json";
var headers = {};
var responseString =
http.request(url,method,JSON.stringify(contentBody),contentType,headers);
}
// This an example of a function that calls a PlayFab Entity API. The function is
called using the
// 'ExecuteEntityCloudScript' API
(https://api.playfab.com/documentation/CloudScript/method/ExecuteEntityCloudScript)
.
handlers.makeEntityAPICall = function (args, context) {
return {
profile: entityProfile,
setResult: apiResult.SetResults[0].SetResult
};
};
var body = {
input: args,
userId: currentPlayerId,
mode: "foobar"
};
// Below are some examples of using Cloud Script in slightly more realistic
scenarios
// This is a function that the game client would call whenever a player completes
// a level. It updates a setting in the player's data that only game server
// code can write - it is read-only on the client - and it updates a player
// statistic that can be used for leaderboards.
//
// A funtion like this could be extended to perform validation on the
// level completion data to detect cheating. It could also do things like
// award the player items from the game catalog based on their performance.
handlers.completedLevel = function (args, context) {
var level = args.levelName;
var monstersKilled = args.monstersKilled;
// In addition to the Cloud Script handlers, you can define your own functions and
call them from your handlers.
// This makes it possible to share code between multiple handlers and to improve
code organization.
handlers.updatePlayerMove = function (args) {
var validMove = processPlayerMove(args);
return { validMove: validMove };
};
// This is a helper function that verifies that the player's move wasn't made
// too quickly following their previous move, according to the rules of the game.
// If the move is valid, then it updates the player's statistics and profile data.
// This function is called from the "UpdatePlayerMove" handler above and also is
// triggered by the "RoomEventRaised" Photon room event in the Webhook handler
// below.
//
// For this example, the script defines the cooldown period
(playerMoveCooldownInSeconds)
// as 15 seconds. A recommended approach for values like this would be to create
them in Title
// Data, so that they can be queries in the script with a call to GetTitleData
// (https://api.playfab.com/Documentation/Server/method/GetTitleData). This would
allow you to
// make adjustments to these values over time, without having to edit, test, and
roll out an
// updated script.
function processPlayerMove(playerMove) {
var now = Date.now();
var playerMoveCooldownInSeconds = 15;
if (lastMoveTimestampSetting) {
var lastMoveTime = Date.parse(lastMoveTimestampSetting.Value);
var timeSinceLastMoveInSeconds = (now - lastMoveTime) / 1000;
log.debug("lastMoveTime: " + lastMoveTime + " now: " + now + "
timeSinceLastMoveInSeconds: " + timeSinceLastMoveInSeconds);
return true;
}
switch (eventData.eventType) {
case "playerMove":