dongqiao3927 2015-09-20 11:07
浏览 26
已采纳

如何检查服务器的投票是否已被计算在内?

I'm trying to make a minecraft server voting system where when you vote for the server for example here: Minecraft servers list You will get certain points for a successful vote. The question is how to check if a player has successfully voted for server or not? Anyway to check the string of "Your vote has been successful" or something? Thank you for your answers.

  • 写回答

1条回答 默认 最新

  • duanchun5520 2015-09-20 11:18
    关注

    On JS side, do an AJAX request when the user vote, and then wait for a callback after the server responded, then you can write "Vote successful" or other stuff.

    On Server side (no matter if this is php or another language), you'll have to store information about the request, like user IP, to prevent him for multiple votes.

    You could also store this information in a cookie on the client side, or in the local storage, but it can easily be cleaned by the user.

    Or even, associate the vote with an email, and associate the email with the request.

    I don't know anyway if there is a definitive solution to prevent multiple votes in this case, because user can create new mail account, modify its IP, go through a proxy, ... Best way is create an auth mechanism that will force each user to be auth before voting, I guess.

    This post only exposes concepts anyway because your question is quite too large to answer it exactly here.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 计算二重积分∫∫e^(x+y)dxdy,其中0≤x≤1,0≤y≤1,试分别用复合辛普森公式(取n=4)以及高斯求积公式(取n=4)计算积分 给出matlab程序
  • ¥15 opencv 无法读取视频
  • ¥15 用matlab 实现通信仿真
  • ¥15 按键修改电子时钟,C51单片机
  • ¥60 Java中实现如何实现张量类,并用于图像处理(不运用其他科学计算库和图像处理库))
  • ¥20 5037端口被adb自己占了
  • ¥15 python:excel数据写入多个对应word文档
  • ¥60 全一数分解素因子和素数循环节位数
  • ¥15 ffmpeg如何安装到虚拟环境
  • ¥188 寻找能做王者评分提取的